# RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -disassemble -show-encoding %s | FileCheck -check-prefix=GFX9 %s

# GFX9: buffer_atomic_add v0, off, s[0:3], src_shared_base offset:4095 ; encoding: [0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xeb]
0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xeb

# GFX9: s_add_i32 s0, src_shared_base, s0 ; encoding: [0xeb,0x00,0x00,0x81]
0xeb,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_shared_limit, s0 ; encoding: [0xec,0x00,0x00,0x81]
0xec,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
0xed,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
0xee,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_pops_exiting_wave_id, s0 ; encoding: [0xef,0x00,0x00,0x81]
0xef,0x00,0x00,0x81

# GFX9: s_and_b64 s[0:1], s[0:1], src_shared_base ; encoding: [0x00,0xeb,0x80,0x86]
0x00,0xeb,0x80,0x86

# GFX9: v_add_u16_sdwa v0, src_shared_base, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x00,0x00,0x4c,0xeb,0x06,0x86,0x06]
0xf9,0x00,0x00,0x4c,0xeb,0x06,0x86,0x06

# GFX9: v_add_u16_sdwa v0, v0, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xd6,0x01,0x4c,0x00,0x06,0x06,0x86]
0xf9,0xd6,0x01,0x4c,0x00,0x06,0x06,0x86

# GFX9: v_add_u32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x68]
0xeb,0x00,0x00,0x68

# GFX9: v_add_u32_e64 v0, src_shared_base, v0 ; encoding: [0x00,0x00,0x34,0xd1,0xeb,0x00,0x02,0x00]
0x00,0x00,0x34,0xd1,0xeb,0x00,0x02,0x00

# GFX9: v_cmp_eq_i64_e32 vcc, src_shared_base, v[0:1] ; encoding: [0xeb,0x00,0xc4,0x7d]
0xeb,0x00,0xc4,0x7d

# GFX9: v_max_f16_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x5a]
0xeb,0x00,0x00,0x5a

# GFX9: v_max_f32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x16]
0xeb,0x00,0x00,0x16

# GFX9: v_max_f64 v[0:1], src_shared_base, v[0:1] ; encoding: [0x00,0x00,0x83,0xd2,0xeb,0x00,0x02,0x00]
0x00,0x00,0x83,0xd2,0xeb,0x00,0x02,0x00

# GFX9: v_pk_add_f16 v0, src_shared_base, v0 ; encoding: [0x00,0x40,0x8f,0xd3,0xeb,0x00,0x02,0x18]
0x00,0x00,0x8f,0xd3,0xeb,0x00,0x02,0x18

# GFX9: v_ceil_f16_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x85,0xd1,0xeb,0x00,0x00,0x20]
0x00,0x00,0x85,0xd1,0xeb,0x00,0x00,0x20

# GFX9: v_ceil_f16_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x85,0xd1,0xeb,0x00,0x00,0x00]
0x00,0x01,0x85,0xd1,0xeb,0x00,0x00,0x00

# GFX9: v_ceil_f64_e64 v[5:6], |src_shared_base| ; encoding: [0x05,0x01,0x58,0xd1,0xeb,0x00,0x00,0x00]
0x05,0x01,0x58,0xd1,0xeb,0x00,0x00,0x00

# GFX9: v_ceil_f64_e64 v[5:6], -src_shared_base ; encoding: [0x05,0x00,0x58,0xd1,0xeb,0x00,0x00,0x20]
0x05,0x00,0x58,0xd1,0xeb,0x00,0x00,0x20

# GFX9: v_ceil_f32_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x5d,0xd1,0xeb,0x00,0x00,0x20]
0x00,0x00,0x5d,0xd1,0xeb,0x00,0x00,0x20

# GFX9: v_ceil_f32_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x5d,0xd1,0xeb,0x00,0x00,0x00]
0x00,0x01,0x5d,0xd1,0xeb,0x00,0x00,0x00

# GFX9: v_ceil_f16_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0xa6,0x00]
0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0xa6,0x00

# GFX9: v_ceil_f16_sdwa v5, -src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0x96,0x00]
0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0x96,0x00

# GFX9: v_ceil_f32_sdwa v5, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0x86,0x00]
0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0x86,0x00

# GFX9: v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0xa6,0x00]
0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0xa6,0x00

# GFX9: buffer_atomic_add v0, off, s[0:3], src_scc offset:4095 ; encoding: [0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xfd]
0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xfd

# GFX9: s_add_i32 s0, src_vccz, s0      ; encoding: [0xfb,0x00,0x00,0x81]
0xfb,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_execz, s0      ; encoding: [0xfc,0x00,0x00,0x81]
0xfc,0x00,0x00,0x81

# GFX9: s_add_i32 s0, src_scc, s0       ; encoding: [0xfd,0x00,0x00,0x81]
0xfd,0x00,0x00,0x81

# GFX9: s_and_b64 s[0:1], s[0:1], src_vccz ; encoding: [0x00,0xfb,0x80,0x86]
0x00,0xfb,0x80,0x86

# GFX9: s_and_b64 s[0:1], s[0:1], src_execz ; encoding: [0x00,0xfc,0x80,0x86]
0x00,0xfc,0x80,0x86

# GFX9: s_and_b64 s[0:1], s[0:1], src_scc ; encoding: [0x00,0xfd,0x80,0x86]
0x00,0xfd,0x80,0x86

# GFX9: v_add_u16_e32 v0, src_vccz, v0  ; encoding: [0xfb,0x00,0x00,0x4c]
0xfb,0x00,0x00,0x4c

# GFX9: v_add_u16_sdwa v0, src_scc, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x00,0x00,0x4c,0xfd,0x06,0x86,0x06]
0xf9,0x00,0x00,0x4c,0xfd,0x06,0x86,0x06

# GFX9: v_add_u16_sdwa v0, v0, src_scc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xfa,0x01,0x4c,0x00,0x06,0x06,0x86]
0xf9,0xfa,0x01,0x4c,0x00,0x06,0x06,0x86

# GFX9: v_add_u32_e32 v0, src_execz, v0 ; encoding: [0xfc,0x00,0x00,0x68]
0xfc,0x00,0x00,0x68

# GFX9: v_add_u32_e64 v0, src_scc, v0   ; encoding: [0x00,0x00,0x34,0xd1,0xfd,0x00,0x02,0x00]
0x00,0x00,0x34,0xd1,0xfd,0x00,0x02,0x00

# GFX9: v_cmp_eq_i64_e32 vcc, src_scc, v[0:1] ; encoding: [0xfd,0x00,0xc4,0x7d]
0xfd,0x00,0xc4,0x7d

# GFX9: v_max_f16_e32 v0, src_execz, v0 ; encoding: [0xfc,0x00,0x00,0x5a]
0xfc,0x00,0x00,0x5a

# GFX9: v_max_f32_e32 v0, src_vccz, v0  ; encoding: [0xfb,0x00,0x00,0x16]
0xfb,0x00,0x00,0x16

# GFX9: v_max_f64 v[0:1], src_scc, v[0:1] ; encoding: [0x00,0x00,0x83,0xd2,0xfd,0x00,0x02,0x00]
0x00,0x00,0x83,0xd2,0xfd,0x00,0x02,0x00

# GFX9: v_pk_add_f16 v0, src_execz, v0  ; encoding: [0x00,0x40,0x8f,0xd3,0xfc,0x00,0x02,0x18]
0x00,0x00,0x8f,0xd3,0xfc,0x00,0x02,0x18

# GFX9: v_ceil_f16_e64 v0, -src_vccz    ; encoding: [0x00,0x00,0x85,0xd1,0xfb,0x00,0x00,0x20]
0x00,0x00,0x85,0xd1,0xfb,0x00,0x00,0x20

# GFX9: v_ceil_f16_e64 v0, |src_scc|    ; encoding: [0x00,0x01,0x85,0xd1,0xfd,0x00,0x00,0x00]
0x00,0x01,0x85,0xd1,0xfd,0x00,0x00,0x00

# GFX9: v_ceil_f64_e64 v[5:6], |src_execz| ; encoding: [0x05,0x01,0x58,0xd1,0xfc,0x00,0x00,0x00]
0x05,0x01,0x58,0xd1,0xfc,0x00,0x00,0x00

# GFX9: v_ceil_f64_e64 v[5:6], -vcc     ; encoding: [0x05,0x00,0x58,0xd1,0x6a,0x00,0x00,0x20]
0x05,0x00,0x58,0xd1,0x6a,0x00,0x00,0x20

# GFX9: v_ceil_f32_e64 v0, -src_vccz    ; encoding: [0x00,0x00,0x5d,0xd1,0xfb,0x00,0x00,0x20]
0x00,0x00,0x5d,0xd1,0xfb,0x00,0x00,0x20

# GFX9: v_ceil_f32_e64 v0, |src_execz|  ; encoding: [0x00,0x01,0x5d,0xd1,0xfc,0x00,0x00,0x00]
0x00,0x01,0x5d,0xd1,0xfc,0x00,0x00,0x00

# GFX9: v_ceil_f16_sdwa v5, |src_vccz| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xfb,0x16,0xa6,0x00]
0xf9,0x8a,0x0a,0x7e,0xfb,0x16,0xa6,0x00

# GFX9: v_ceil_f16_sdwa v5, -src_scc dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xfd,0x16,0x96,0x00]
0xf9,0x8a,0x0a,0x7e,0xfd,0x16,0x96,0x00

# GFX9: v_ceil_f32_sdwa v5, src_vccz dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xfb,0x16,0x86,0x00]
0xf9,0x3a,0x0a,0x7e,0xfb,0x16,0x86,0x00

# GFX9: v_ceil_f32_sdwa v5, |src_execz| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xfc,0x16,0xa6,0x00]
0xf9,0x3a,0x0a,0x7e,0xfc,0x16,0xa6,0x00
